<template>
	<view class="content">
		<text class="title-1">子组件A</text>
		<view class="coma_box">
			<text>父组件传进来的值:</text>
			<text style="font-weight: bold;color: red;">{{intent}}</text>
		</view>
		<view class="coma_box">
		<button type="primary" @click="sendData()">传值给ComB组件</button>
		</view>
	</view>
</template>

<script>
	export default {
		name:"ComA",
		props:['intent','xxx'],
		data() {
			return {
				
			};
		},
		created() {
			console.log("created comA");
		},
		mounted() {
			console.log("mounted comA");
		},
		methods:{
			sendData(){
				console.log('sendData');
				uni.$emit('fasong',this.intent);
			}
		}
	}
</script>

<style>
	.content{
		margin: 30px;
		padding: 20px;
		border-radius: 10px;
		background-color: coral;
		box-shadow: 0 2px 4px rgba(1, 0.5, 0.4, 0.4);
	}
	.title-1{
		padding-top: 5rpx;
		font-size: 30px;
		font-weight: bold;
		display: block;
		margin-bottom: 8px;
		text-align: center;
	}
	.coma_box{
		margin-top: 10px;
	}
</style>